﻿using System;
using System.Collections.Generic;
using System.Collections;

namespace Pap.Data
{
    /// <summary>
    /// 
    /// </summary>
    public interface IAdministrationRepository : IRepository
    {
        #region Villages

        /// <summary>
        /// Gets the village by ID.
        /// </summary>
        /// <param name="VillageID">The village ID.</param>
        /// <returns></returns>
        IVillage GetVillageByID(Guid VillageID);

        /// <summary>
        /// Finds the villages.
        /// </summary>
        /// <param name="Where">The where.</param>
        /// <returns></returns>
        IEnumerable<IVillage> FindVillages(System.Linq.Expressions.Expression<Func<IVillage, bool>> Where);

        /// <summary>
        /// Creates the village.
        /// </summary>
        /// <param name="Village">The village.</param>
        void CreateVillage(IVillage Village);

        /// <summary>
        /// Deletes the villages.
        /// </summary>
        /// <param name="Where">The where.</param>
        void DeleteVillages(System.Linq.Expressions.Expression<Func<IVillage, bool>> Where);

        #endregion

        #region Committees

        /// <summary>
        /// Gets the committee by ID.
        /// </summary>
        /// <param name="CommitteeID">The committee ID.</param>
        /// <returns></returns>
        ICommittee GetCommitteeByID(Guid CommitteeID);

        /// <summary>
        /// Finds the committees.
        /// </summary>
        /// <param name="Where">The where.</param>
        /// <returns></returns>
        IEnumerable<ICommittee> FindCommittees(System.Linq.Expressions.Expression<Func<ICommittee, bool>> Where);

        /// <summary>
        /// Creates the committee.
        /// </summary>
        /// <param name="Committee">The committee.</param>
        void CreateCommittee(ICommittee Committee);

        /// <summary>
        /// Deletes the committees.
        /// </summary>
        /// <param name="Where">The where.</param>
        void DeleteCommittees(System.Linq.Expressions.Expression<Func<ICommittee, bool>> Where);

        /// <summary>
        /// Deletes the committee villages.
        /// </summary>
        /// <param name="Committee">The committee.</param>
        void DeleteCommitteeVillages(ICommittee Committee);

        #endregion

        #region CommitteeBankAccounts

        /// <summary>
        /// Gets the committee bank account by ID.
        /// </summary>
        /// <param name="CommitteeBankAccountID">The committee bank account ID.</param>
        /// <returns></returns>
        ICommitteeBankAccount GetCommitteeBankAccountByID(Guid CommitteeBankAccountID);

        /// <summary>
        /// Finds the committee bank accounts.
        /// </summary>
        /// <param name="Where">The where.</param>
        /// <returns></returns>
        IEnumerable<ICommitteeBankAccount> FindCommitteeBankAccounts(System.Linq.Expressions.Expression<Func<ICommitteeBankAccount, bool>> Where);

        /// <summary>
        /// Creates the committee bank account.
        /// </summary>
        /// <param name="CommitteeBankAccount">The committee bank account.</param>
        void CreateCommitteeBankAccount(ICommitteeBankAccount CommitteeBankAccount);

        /// <summary>
        /// Deletes the committee bank accounts.
        /// </summary>
        /// <param name="Where">The where.</param>
        void DeleteCommitteeBankAccounts(System.Linq.Expressions.Expression<Func<ICommitteeBankAccount, bool>> Where);

        #endregion

        #region CommitteeBankAccountDeposites

        /// <summary>
        /// Gets the committee bank account deposite by ID.
        /// </summary>
        /// <param name="CommitteeBankAccountDepositeID">The committee bank account deposite ID.</param>
        /// <returns></returns>
        ICommitteeBankAccountDeposite GetCommitteeBankAccountDepositeByID(Guid CommitteeBankAccountDepositeID);

        /// <summary>
        /// Finds the committee bank account deposites.
        /// </summary>
        /// <param name="Where">The where.</param>
        /// <returns></returns>
        IEnumerable<ICommitteeBankAccountDeposite> FindCommitteeBankAccountDeposites(System.Linq.Expressions.Expression<Func<ICommitteeBankAccountDeposite, bool>> Where);

        /// <summary>
        /// Creates the committee bank account deposite.
        /// </summary>
        /// <param name="CommitteeBankAccountDeposite">The committee bank account deposite.</param>
        void CreateCommitteeBankAccountDeposite(ICommitteeBankAccountDeposite CommitteeBankAccountDeposite);

        /// <summary>
        /// Deletes the committee bank account deposites.
        /// </summary>
        /// <param name="Where">The where.</param>
        void DeleteCommitteeBankAccountDeposites(System.Linq.Expressions.Expression<Func<ICommitteeBankAccountDeposite, bool>> Where);

        #endregion

        #region CommitteeBankAccountDepositeReceipt

        /// <summary>
        /// Gets the committee bank account deposit receipt by ID.
        /// </summary>
        /// <param name="CommitteeBankAccountDepositReceiptID">The committee bank account deposit receipt ID.</param>
        /// <returns></returns>
        ICommitteeBankAccountDepositReceipt GetCommitteeBankAccountDepositReceiptByID(Guid CommitteeBankAccountDepositReceiptID);

        /// <summary>
        /// Finds the committee bank account deposit receiptes.
        /// </summary>
        /// <param name="where">The where.</param>
        /// <returns></returns>
        IEnumerable<ICommitteeBankAccountDepositReceipt> FindCommitteeBankAccountDepositReceiptes(System.Linq.Expressions.Expression<Func<ICommitteeBankAccountDepositReceipt, bool>> where);

        /// <summary>
        /// Creates the committee bank account deposit receipt.
        /// </summary>
        /// <param name="CommitteeBankAccountDepositReceipt">The committee bank account deposit receipt.</param>
        void CreateCommitteeBankAccountDepositReceipt(ICommitteeBankAccountDepositReceipt CommitteeBankAccountDepositReceipt);

        /// <summary>
        /// Deletes the committee bank account deposit receiptes.
        /// </summary>
        /// <param name="where">The where.</param>
        void DeleteCommitteeBankAccountDepositReceiptes(System.Linq.Expressions.Expression<Func<ICommitteeBankAccountDepositReceipt, bool>> where);

        #endregion

        #region CommitteeBankAccountDepositAttachment

        /// <summary>
        /// Gets the committee bank account deposit attachment by ID.
        /// </summary>
        /// <param name="committeeBankAccountDepositAttachmentID">The committee bank account deposit attachment ID.</param>
        /// <returns></returns>
        ICommitteeBankAccountDepositAttachment GetCommitteeBankAccountDepositAttachmentByID(Guid committeeBankAccountDepositAttachmentID);

        /// <summary>
        /// Finds the committee bank account deposit attachments.
        /// </summary>
        /// <param name="where">The where.</param>
        /// <returns></returns>
        IEnumerable<ICommitteeBankAccountDepositAttachment> FindCommitteeBankAccountDepositAttachments(System.Linq.Expressions.Expression<Func<ICommitteeBankAccountDepositAttachment, bool>> where);

        /// <summary>
        /// Creates the committee bank account deposit attachment.
        /// </summary>
        /// <param name="committeeBankAccountDepositAttachment">The committee bank account deposit attachment.</param>
        void CreateCommitteeBankAccountDepositAttachment(ICommitteeBankAccountDepositAttachment committeeBankAccountDepositAttachment);

        /// <summary>
        /// Deletes the committee bank account deposit attachments.
        /// </summary>
        /// <param name="where">The where.</param>
        void DeleteCommitteeBankAccountDepositAttachments(System.Linq.Expressions.Expression<Func<ICommitteeBankAccountDepositAttachment, bool>> where);

        #endregion

        #region CommitteeBankAccountExpenses

        /// <summary>
        /// Gets the committee bank account expense by ID.
        /// </summary>
        /// <param name="committeeBankAccountExpenseID">The committee bank account expense ID.</param>
        /// <returns></returns>
        ICommitteeBankAccountExpense GetCommitteeBankAccountExpenseByID(Guid committeeBankAccountExpenseID);

        /// <summary>
        /// Finds the committee bank account expenses.
        /// </summary>
        /// <param name="where">The where.</param>
        /// <returns></returns>
        IEnumerable<ICommitteeBankAccountExpense> FindCommitteeBankAccountExpenses(System.Linq.Expressions.Expression<Func<ICommitteeBankAccountExpense, bool>> where);

        /// <summary>
        /// Creates the committee bank account expense.
        /// </summary>
        /// <param name="committeeBankAccountExpense">The committee bank account expense.</param>
        void CreateCommitteeBankAccountExpense(ICommitteeBankAccountExpense committeeBankAccountExpense);

        /// <summary>
        /// Deletes the committee bank account expenses.
        /// </summary>
        /// <param name="where">The where.</param>
        void DeleteCommitteeBankAccountExpenses(System.Linq.Expressions.Expression<Func<ICommitteeBankAccountExpense, bool>> where);

        #endregion

        #region CommitteeBankAccountMainBranchDeposites

        /// <summary>
        /// Gets the committee bank account main branch deposite by ID.
        /// </summary>
        /// <param name="committeeBankAccountMainBranchDepositeID">The committee bank account main branch deposite ID.</param>
        /// <returns></returns>
        ICommitteeBankAccountMainBranchDeposite GetCommitteeBankAccountMainBranchDepositeByID(Guid committeeBankAccountMainBranchDepositeID);

        /// <summary>
        /// Finds the committee bank account main branch deposites.
        /// </summary>
        /// <param name="where">The where.</param>
        /// <returns></returns>
        IEnumerable<ICommitteeBankAccountMainBranchDeposite> FindCommitteeBankAccountMainBranchDeposites(System.Linq.Expressions.Expression<Func<ICommitteeBankAccountMainBranchDeposite, bool>> where);

        /// <summary>
        /// Creates the committee bank account main branch deposite.
        /// </summary>
        /// <param name="committeeBankAccountMainBranchDeposite">The committee bank account main branch deposite.</param>
        void CreateCommitteeBankAccountMainBranchDeposite(ICommitteeBankAccountMainBranchDeposite committeeBankAccountMainBranchDeposite);

        /// <summary>
        /// Deletes the committee bank account main branch deposites.
        /// </summary>
        /// <param name="where">The where.</param>
        void DeleteCommitteeBankAccountMainBranchDeposites(System.Linq.Expressions.Expression<Func<ICommitteeBankAccountMainBranchDeposite, bool>> where);

        #endregion

        #region CommitteeBankAccountMainBranchDepositAttachments

        /// <summary>
        /// Gets the committee bank account main branch deposit attachment by ID.
        /// </summary>
        /// <param name="committeeBankAccountMainBranchDepositAttachmentID">The committee bank account main branch deposit attachment ID.</param>
        /// <returns></returns>
        ICommitteeBankAccountMainBranchDepositAttachment GetCommitteeBankAccountMainBranchDepositAttachmentByID(Guid committeeBankAccountMainBranchDepositAttachmentID);

        /// <summary>
        /// Finds the committee bank account main branch deposit attachments.
        /// </summary>
        /// <param name="where">The where.</param>
        /// <returns></returns>
        IEnumerable<ICommitteeBankAccountMainBranchDepositAttachment> FindCommitteeBankAccountMainBranchDepositAttachments(System.Linq.Expressions.Expression<Func<ICommitteeBankAccountMainBranchDepositAttachment, bool>> where);


        /// <summary>
        /// Creates the committee bank account main branch deposit attachment.
        /// </summary>
        /// <param name="CommitteeBankAccountMainBranchDepositAttachment">The committee bank account main branch deposit attachment.</param>
        void CreateCommitteeBankAccountMainBranchDepositAttachment(ICommitteeBankAccountMainBranchDepositAttachment CommitteeBankAccountMainBranchDepositAttachment);


        /// <summary>
        /// Deletes the committee bank account main branch deposit attachments.
        /// </summary>
        /// <param name="where">The where.</param>
        void DeleteCommitteeBankAccountMainBranchDepositAttachments(System.Linq.Expressions.Expression<Func<ICommitteeBankAccountMainBranchDepositAttachment, bool>> where);


        #endregion

        #region [CommitteesURLs]

        /// <summary>
        /// Finds the committees UR ls.
        /// </summary>
        /// <param name="Where">The where.</param>
        /// <returns></returns>
        IEnumerable<ICommitteesURL> FindCommitteesURLs(System.Linq.Expressions.Expression<Func<ICommitteesURL, bool>> Where);

        IEnumerable<ICommitteesURL> GetAllCommitteesURLs();

        void CreateURLToNewCommittees();

        #endregion

        #region MainCommitteeDeposits

        /// <summary>
        /// Gets the main committee deposit ID.
        /// </summary>
        /// <param name="MainCommitteeDepositID">The main committee deposit ID.</param>
        /// <returns></returns>
        IMainCommitteeDeposit GetMainCommitteeDepositID(Guid MainCommitteeDepositID);

        /// <summary>
        /// Finds the main committee deposites.
        /// </summary>
        /// <param name="where">The where.</param>
        /// <returns></returns>
        IEnumerable<IMainCommitteeDeposit> FindMainCommitteeDeposites(System.Linq.Expressions.Expression<Func<IMainCommitteeDeposit, bool>> where);

        /// <summary>
        /// Creates the main committee deposite.
        /// </summary>
        /// <param name="MainCommitteeDeposit">The main committee deposit.</param>
        void CreateMainCommitteeDeposite(IMainCommitteeDeposit MainCommitteeDeposit);

        /// <summary>
        /// Deletes the main committee deposites.
        /// </summary>
        /// <param name="where">The where.</param>
        void DeleteMainCommitteeDeposites(System.Linq.Expressions.Expression<Func<IMainCommitteeDeposit, bool>> where);

        #endregion

        #region MainCommitteeExpenses

        /// <summary>
        /// Gets the main committee expense ID.
        /// </summary>
        /// <param name="MainCommitteeExpenseID">The main committee expense ID.</param>
        /// <returns></returns>
        IMainCommitteeExpense GetMainCommitteeExpenseID(Guid MainCommitteeExpenseID);

        /// <summary>
        /// Finds the main committee expenses.
        /// </summary>
        /// <param name="where">The where.</param>
        /// <returns></returns>
        IEnumerable<IMainCommitteeExpense> FindMainCommitteeExpenses(System.Linq.Expressions.Expression<Func<IMainCommitteeExpense, bool>> where);

        /// <summary>
        /// Creates the main committee expense.
        /// </summary>
        /// <param name="MainCommitteeExpense">The main committee expense.</param>
        void CreateMainCommitteeExpense(IMainCommitteeExpense MainCommitteeExpense);

        /// <summary>
        /// Deletes the main committee expenses.
        /// </summary>
        /// <param name="where">The where.</param>
        void DeleteMainCommitteeExpenses(System.Linq.Expressions.Expression<Func<IMainCommitteeExpense, bool>> where);

        #endregion

        #region Centers

        /// <summary>
        /// Gets the center by ID.
        /// </summary>
        /// <param name="CenterID">The center ID.</param>
        /// <returns></returns>
        ICenter GetCenterByID(Guid CenterID);

        /// <summary>
        /// Finds the centers.
        /// </summary>
        /// <param name="Where">The where.</param>
        /// <returns></returns>
        IEnumerable<ICenter> FindCenters(System.Linq.Expressions.Expression<Func<ICenter, bool>> Where);

        /// <summary>
        /// Creates the center.
        /// </summary>
        /// <param name="Center">The center.</param>
        void CreateCenter(ICenter Center);

        /// <summary>
        /// Deletes the centers.
        /// </summary>
        /// <param name="Where">The where.</param>
        void DeleteCenters(System.Linq.Expressions.Expression<Func<ICenter, bool>> Where);

        #endregion

        #region SettingCategories
        /// <summary>
        /// Gets the settings for committee.
        /// </summary>
        /// <param name="committeeID">The committee ID.</param>
        /// <returns></returns>
        IEnumerable<ISettingCategory> GetSettingsForCommittee(Guid committeeID);
        /// <summary>
        /// Gets the label to setting mapping.
        /// </summary>
        /// <param name="committeeID">The committee ID.</param>
        /// <returns></returns>
        Dictionary<string, ISetting> GetLabelToSettingMapping(Guid committeeID);
        /// <summary>
        /// Gets all committees.
        /// </summary>
        /// <returns></returns>
        IEnumerable<ICommittee> GetAllCommittees();

        /// <summary>
        /// Gets all non main committees.
        /// </summary>
        /// <returns></returns>
        IEnumerable<ICommittee> GetAllNonMainCommittees();

        /// <summary>
        /// Gets the setting value.
        /// </summary>
        /// <param name="CommitteeID">The committee ID.</param>
        /// <param name="settingKey">The setting key.</param>
        /// <returns></returns>
        string GetSettingValue(Guid CommitteeID, SettingKeys settingKey);
        #endregion

        #region Projects

        /// <summary>
        /// Gets the last stage.
        /// </summary>
        /// <returns></returns>
        IProjectStage GetLastStage();

        /// <summary>
        /// Gets the stage by number.
        /// </summary>
        /// <param name="stageNumber">The stage number.</param>
        /// <returns></returns>
        IProjectStage GetStageByNumber(int stageNumber);

        /// <summary>
        /// Gets the previous stage.
        /// </summary>
        /// <param name="stage">The stage.</param>
        /// <returns></returns>
        IProjectStage GetPreviousStage(IProjectStage stage);

        /// <summary>
        /// Gets the next stage.
        /// </summary>
        /// <param name="stage">The stage.</param>
        /// <returns></returns>
        IProjectStage GetNextStage(IProjectStage stage);

        /// <summary>
        /// Deletes the stage.
        /// </summary>
        /// <param name="stage">The stage.</param>
        void DeleteStage(IProjectStage stage);

        /// <summary>
        /// Gets the project by id.
        /// </summary>
        /// <param name="projectId">The project id.</param>
        /// <returns></returns>
        IProject GetProjectById(Guid projectId);

        /// <summary>
        /// Finds the projects.
        /// </summary>
        /// <param name="where">The where.</param>
        /// <returns></returns>
        IEnumerable<IProject> FindProjects(System.Linq.Expressions.Expression<Func<IProject, bool>> where);

        /// <summary>
        /// Creates the project.
        /// </summary>
        /// <param name="project">The project.</param>
        void CreateProject(IProject project);

        /// <summary>
        /// Deletes the project.
        /// </summary>
        /// <param name="project">The project.</param>
        void DeleteProject(IProject project);

        /// <summary>
        /// Gets the user project.
        /// </summary>
        /// <param name="userID">The user ID.</param>
        /// <returns></returns>
        IEnumerable<IProject> GetUserProjects(Guid userID);

        #endregion

        #region ProjectStages

        /// <summary>
        /// Gets the project stage by ID.
        /// </summary>
        /// <param name="ProjectStageID">The project stage ID.</param>
        /// <returns></returns>
        IProjectStage GetProjectStageByID(Guid ProjectStageID);

        /// <summary>
        /// Finds the project stages.
        /// </summary>
        /// <param name="Where">The where.</param>
        /// <returns></returns>
        IEnumerable<IProjectStage> FindProjectStages(System.Linq.Expressions.Expression<Func<IProjectStage, bool>> Where);

        /// <summary>
        /// Creates the project stage.
        /// </summary>
        /// <param name="ProjectStage">The project stage.</param>
        void CreateProjectStage(IProjectStage ProjectStage);

        /// <summary>
        /// Deletes the project stages.
        /// </summary>
        /// <param name="Where">The where.</param>
        void DeleteProjectStages(System.Linq.Expressions.Expression<Func<IProjectStage, bool>> Where);

        #endregion

        #region DatabaseManagement

        /// <summary>
        /// Backups the database.
        /// </summary>
        void BackupDatabase(string path);

        /// <summary>
        /// Restores the databas.
        /// </summary>
        void RestoreDatabas(string path);

        #endregion



        #region Receipts
        long GetNextReceiptNumber(Guid CommitteeID);
        #endregion

        // IEnumerable<ICommittee> GetAllMonths();

        void UpdateCommitteesURLs(List<Guid> committeeIDs, List<string> URLs);

        ICommitteesURL GetCommittesURLByCommiteeID(Guid CommitteeID);

        void CreateCommitteeURL(ICommitteesURL CommitteeUrl);
    }
}
